<template>
    <div class="center">
        <h2>我是哈哈哈</h2>
        <h2>当前计数:{{ counter }}</h2>
        <button @click="counter++">+1</button>
    </div>
</template>
<script>
// import { onDeactivated } from 'vue';


export default {
    // 会来回销毁
    // include缓存要加name
    name: "center",
    data() {
        return {
            counter: 0
        }
    },
    created() {
        console.log("center created");
    },
    unmounted() {
        console.log("center unmounted")
    },
    // 生命周期两个钩子函数 实现监听
    activated() {
        console.log("center activered");
    },
    deactivated() {
        console.log("center deactivated");
    }
}
</script>
<style scoped lang="less"></style>